package com.zhongkai.service.ticket;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhongkai.model.config.User;
import com.zhongkai.model.ticket.TDjWjccstz;
import com.zhongkai.service.BaseService;
@Service
@Transactional
public class info_without_taxService extends BaseService {
	
	public TDjWjccstz insert(TDjWjccstz tdjwjccstz,HttpServletRequest request) throws Exception
	{
		Date currentdate=new Date();
		String tmpsbqsny="";
		User user=(User)request.getSession().getAttribute("user");
		tdjwjccstz.setCzrDm(user.getUserIdentifier());
		tdjwjccstz.setXgrDm(user.getUserIdentifier());
		tdjwjccstz.setCzRq(currentdate);
		tdjwjccstz.setXgRq(currentdate);
		tdjwjccstz.setCjRq(currentdate);
		tmpsbqsny=tdjwjccstz.getSbqsny().split("-")[0]+tdjwjccstz.getSbqsny().split("-")[1];
		tdjwjccstz.setSbqsny(tmpsbqsny);
		insert(tdjwjccstz);
		return null;
	}
	public TDjWjccstz update(TDjWjccstz tdjwjccstz,HttpServletRequest request) throws Exception
	{
		Date currentdate=new Date();
		User user=(User)request.getSession().getAttribute("user");
		String tmpsbqsny="";
		tdjwjccstz.setZfBj("Y");
		tdjwjccstz.setXgrDm(user.getUserIdentifier());
		tdjwjccstz.setXgRq(currentdate);
		tmpsbqsny=tdjwjccstz.getSbqsny().split("-")[0]+tdjwjccstz.getSbqsny().split("-")[1];
		tdjwjccstz.setSbqsny(tmpsbqsny);
		update(tdjwjccstz);
		return null;
	}
}
